// 引入 react 依赖
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Text, View, Image, TouchableOpacity, ImageBackground, ScrollView, RefreshControl } from 'react-native';

// 引入第三方依赖
import _ from 'lodash';
import pureRender from 'pure-render-decorator';

// antd 按需加载
import { } from '@ant-design/react-native';

// 引入 处理数据 所需文件
import { } from './module.js'

// 引入样式
import Styles from './style.js';

// 引入公用组件
import { } from '../../components/index.js'

// 引入工具包
import { size, ScreenWidth } from '../../util/utils.js'
class RefreshScrollView extends Component {
	static propTypes = {

	}

	constructor(props) {
		super(props)
		this.state = {}
	}

	onRefresh = () => {
		const { onRefresh } = this.props
		onRefresh()
	}

	render() {
		const { style, children, refreshing, progressBackgroundColor, ...props } = this.props
		return (
			<ScrollView
				style={{
					flex: 1,
					...style
				}}
				refreshControl={
					<RefreshControl
						refreshing={refreshing}
						onRefresh={this.onRefresh}
						colors={'#fff'}
						tintColor={'#fff'}
					// progressBackgroundColor={'#fff'}

					/>
				}
				{...props}
			>
				{children}
			</ScrollView>
		)
	}
}

export default pureRender(RefreshScrollView)
